package allen.test;

import java.util.Scanner;

public class PrintCircle {

	static Integer radius;
	
	public static void printCircle(Integer r){
		for (int i=1; i<=r; i++){
			for (int j=1; j<=r; j++){
				System.out.print(" x ");
			}
			System.out.println("");
		}
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input;
//		sc.useDelimiter("\n");

		System.out.println("Please input the radiius of the circle to printtt:");
		while (sc.hasNext()){
			input = sc.next();
			if (input.equals("exit")){
				System.out.println("Thanks, GAME OVER!");
				break;
			}else{
				try{
					PrintCircle.radius = Integer.parseInt(input);
					if (PrintCircle.radius < 0) {
						PrintCircle.radius = - PrintCircle.radius;
					}
					
					
				}catch (Exception e){
					System.out.println("Sorry, not invalid input, try again.");
					continue;
				}				
			}
			PrintCircle.printCircle(PrintCircle.radius);
			
			return;
		}

	}

}
